package org.redis.cluster.event;

import org.redis.cluster.RedisCluster;
import org.redis.cluster.extension.ExtensionLoader;
import org.redis.cluster.plugin.Plugin;

public class DefaultEventPusherFactory implements EventPusherFactory,Plugin {
	
	private final static String EVENT_PUSHER="eventPusher";
	
	private RedisCluster redisCluster;
	private ExtensionLoader extensionLoader;
	
	@Override
	public void init(RedisCluster redisCluster) {
		this.redisCluster=redisCluster;
		this.extensionLoader=redisCluster.getExtensionLoader();
	}
	
	@Override
	public void destroy() {
	}

	@Override
	public EventPusher getEventPusher() {
		return extensionLoader.load(EVENT_PUSHER, EventPusher.class);
	}
}